<template>
  <div class="app-container">
    <el-row>
      <el-col :span="24">
        <el-form ref="searchForm" :inline="true" :model="searchForm" size="small">
          <el-form-item label="搜索名称" prop="server_name">
            <el-input v-model="searchForm.server_name" size="small" placeholder="待改"/>
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              size="small"
              icon="search"
              @click="searchToolChange('searchForm')">查询
            </el-button>
            <el-button type="primary" size="small" @click="searchToolReset('searchForm')">重置</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
    <el-row>
      <el-table :data="tableData3" border highlight-current-row size="small" style="width: 100%">
        <el-table-column label="序号" type="index" width="65"/>
        <el-table-column prop="transfer_time" label="调取时间" width="150"/>
        <el-table-column prop="package_name" label="套餐"/>
        <el-table-column prop="transfer_ip" label="调取者IP"/>
        <el-table-column prop="ip" label="IP"/>
        <el-table-column prop="port" label="端口"/>
        <el-table-column prop="protocol" label="协议"/>
        <el-table-column prop="province" label="省份"/>
        <el-table-column prop="city" label="城市"/>
        <el-table-column prop="mobile" label="运营商"/>
        <el-table-column prop="use_time" label="使用时间" width="150"/>
        <el-table-column prop="is_deduct" label="是否扣费"/>
        <el-table-column prop="deduct_money" label="扣费金额"/>
        <el-table-column prop="balance" label="余额"/>
      </el-table>
    </el-row>
    <el-row>
      <el-col :span="12" :offset="12">
        <div style="float: right;">
          <el-pagination
            :current-page.sync="currentPage"
            :page-sizes="[10, 25, 50, 100]"
            :page-size="100"
            :total="1000"
            layout="total, sizes, prev, pager, next, jumper"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"/>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'UseLog',
  components: {},
  data() {
    return {
      currentPage: 1,
      searchForm: {
        server_name: ''
      },
      tableData3: [
        {
          transfer_time: '2019-01-01 01:01:01',
          package_name: '全套',
          transfer_ip: '127.0.0.1',
          ip: '0.0.0.0',
          port: '8888',
          protocol: 'http/https',
          province: '四川',
          city: '成都',
          mobile: '电信',
          use_time: '2019-01-01 01:01:01',
          is_deduct: '是',
          deduct_money: '0.5',
          balance: '99.50'
        }
      ]
    }
  },
  methods: {
    handleSizeChange(v) {
      console.log(v)
    },
    handleCurrentChange(v) {
      console.log(v)
    },
    searchToolReset(name) {
      this.$refs[name].resetFields()
    },
    searchToolChange(name) {
      console.log(name)
    }
  }
}
</script>

<style lang="scss" scoped>
  .tab-container{
    margin: 20px 0 0 20px;
  }
</style>
